<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>平仓列表 - Powered By Betou</title>
<meta name="author" content="Betou Team" />
<meta name="copyright" content="Betou" />
<#include "../../head_list.html"/>
<script type="text/javascript">
$().ready(function() {

	var $listForm = $("#listForm");
	var $filterSelect = $("#filterSelect");
	var $filterOption = $("#filterOption a");
	
	$('#filterSelect2,filterSelect').mouseover(function() {
		var $this = $(this);
		var offset = $this.offset();
		var $menuWrap = $this.closest("div.menuWrap");
		var $popupMenu = $menuWrap.children("div.popupMenu");
		$popupMenu.css({left: offset.left, top: offset.top + $this.height() + 2}).show();
		$menuWrap.mouseleave(function() {
			$popupMenu.hide();
		});
	});
	
	$filterOption.click(function() {
		var $this = $(this);
		var $dest = $("#" + $this.attr("name"));
		if ($this.hasClass("checked")) {
			$dest.val("");
		} else {
			$dest.val($this.attr("val"));
		}
		$listForm.submit();
		return false;
	});
	var filterStatus = '${filterStatus!}';
	$.each($filterOption,function(i,e){
		var $this = $(this);
		if( $this.attr("val") == filterStatus ){
			$this.addClass('checked');
		}
	})
	<#if pagination.totalCount==0>
		$.message("warn", "暂无数据！");
	</#if>
});
</script>
</head>
<body class="content">
	<div class="path">
		<a href="../index.jspx">首页</a> &raquo; 平仓列表 <span>(共<span id="pageTotal">${pagination.totalCount!0}</span>条记录)</span>
	</div>
	<form id="listForm"  class="clearfix" action="v_list.jspx" method="post">
		<div class="bar">
			<div class="buttonWrap">
				<a href="javascript:;" id="deleteButton" class="iconButton disabled">
					<span class="deleteIcon">&nbsp;</span>删除
				</a>
				<a href="javascript:;" id="refreshButton" class="iconButton">
					<span class="refreshIcon">&nbsp;</span>刷新
				</a>
				<div class="menuWrap">
					<a class="button" id="filterSelect" href="javascript:;">
						筛选<span class="arrow">&nbsp;</span>
					</a>
					<div class="popupMenu" style="left: 139px; top: 59px; display: none;">
						<ul class="check" id="filterOption">
							<li>
								<a val="direction,false,bool"  name="filterStatus" href="javascript:;">多单</a>
							</li>
							<li>
								<a val="direction,true,bool"   name="filterStatus" href="javascript:;">空单</a>
							</li>
						</ul>
					</div>
				</div>
				
				<div class="menuWrap">
					<a class="button" id="filterSelect2" href="javascript:;">选择数据<span class="arrow">&nbsp;</span></a>
					<div class="popupMenu" style="left: 139px; top: 59px; display: none;">
						<ul class="check" >
							<li><a href="../share/v_list.jspx?view=closeTrade"  target="_blank">看看机构的数据</a></li>
						</ul>
					</div>
				</div>
				
				<#include "../../pageselect.html"/>
			</div>
			<div class="menuWrap">
				<div class="search">
					<span id="searchPropertySelect" class="arrow">&nbsp;</span>
					<input type="text"  id="searchValue" name="searchValue" value="${searchValue!}" maxlength="200" />
					<button type="submit">&nbsp;</button>
				</div>
				<div class="popupMenu">
					<ul id="searchPropertyOption">
						<li><a href="javascript:;" val="category.name">品种</a></li>
						<li><a href="javascript:;" val="admin.username">发布人</a></li>
					</ul>
				</div>
			</div>
		</div>
		<table id="listTable" class="list">
			<tr>
				<th class="check"><input type="checkbox" id="selectAll" /></th>
				<th><a href="javascript:;" class="sort" name="admin.id">发布人</a></th>
				<th><a href="javascript:;" class="sort" name="orientedGroup">面向用户</a></th>
				<th><a href="javascript:;" class="sort" name="category.id">品种</a></th>
				<th><a href="javascript:;" class="sort" name="direction">买卖方向</a></th>
				<th><a href="javascript:;" class="sort" name="openPosition">开仓价位</a></th>
				<th><a href="javascript:;" class="sort" name="closePosition">平仓价位</a></th>
				<th><a href="javascript:;" class="sort" name="profit">盈亏</a></th>
				<th><a href="javascript:;" class="sort" name="startDate">开仓时间</a></th>
				<th><a href="javascript:;" class="sort" name="endDate">平仓时间</a></th>
				<th><span>操作</span></th>
			</tr>
			<#list pagination.list as c>
				<tr>
					<td><input type="checkbox" name="ids"  title=""  value="${c.id!}" /></td>
					<td>
						<#if c.admin.id == admin.id>
							<span class="blue" title="我的平仓">${c.admin.username!}</span>
						<#else>
							${c.admin.username!}
						</#if>
					</td>
					<td>
						<#list groupList as g >
								<#list c.groups as gg>
									<#if g.id == gg>
										[${g.name!}]
									</#if>
								</#list>
							</#list>
					</td>
					<td>${c.category.name!}</td>
					<td>
						<#if c.direction>
							<span class="green">空单</span>
						<#else>
							<span class="blue">多单</span>
						</#if>
					</td>
					<td><span class="red" title="${c.openPosition!}">${c.formatOpenPosition!}</span></td>	
					<td><span class="red" title="${c.closePosition!}">${c.formatClosePosition!}</span></td>	
					<td><span class="red" title="${c.profit!}">${c.formatProfil!}</span></td>	
					<td>
						${c.startDate?string('yyyy-MM-dd hh:mm:ss')} 
					</td>
					<td>${c.endDate?string('yyyy-MM-dd hh:mm:ss')} </td>
					<td>
						<a href="v_edit.jspx?id=${c.id!}">[编辑]</a>
					</td>
				</tr>
			</#list>
		</table>
		<#include "../../list_hidden.html" />
		<#include "../../page.html" />
	</form>
</body>
</html>